<?php if($data->zpc_parentid==0){
		  	$ulclass= 'main_class';
		  	$liclass= 'main_type';
	  }elseif($data->zpc_topid==0){
		  	$ulclass= 'item';
		  	$liclass= 'sub_type';
	  }else{
		  	$ulclass= 'sub_class';
		  	$liclass= 'sub_type';
	   }
?>

<li class="<?php echo $liclass ?>">
<div class="item <?php echo ($data->zpc_parentid==0)?"main":"" ?>">
 <?php echo CHtml::hiddenField('data[zpc_id][]',$data->zpc_id)?>
    <ul class="c_f type">
      <li class="a"><span class="mem_ico ico_fold"></span> <?php echo CHtml::textField('data[zpc_catname][]',$data->zpc_catname,array('class'=>'t_ipt','maxleagth'=>20))?> </li>
      <li class="b">
        <?php if($data->zpc_parentid==0){?>
        <a class="mem_ico ord_1 up p_up" href="javascript:" title="已经是最上了"></a><a class="mem_ico ord_4 down p_down" href="javascript:" title="向下移动"></a>
        <?php }else{?>
          <?php 
           $childidCount =  count(CmpCat::model()->getCatidarray($data->zpc_parentid));
          ?>
          <?php if($index==0) { ?>
              <a title="已经是最上了" href="javascript:" class="mem_ico ord_5 up c_up"></a> 
              <a title="向下移动" href="javascript:" class="mem_ico ord_8 down c_down"></a> 
          <?php }else if($index==$childidCount-1){ ?>
              <a title="向上移动" href="javascript:" class="mem_ico ord_7 up c_up"></a>
              <a title="向下移动" href="javascript:" class="mem_ico ord_6 down c_down"></a>           
          <?php }else { ?>
              <a title="向上移动" href="javascript:" class="mem_ico ord_7 up c_up"></a>
              <a title="向下移动" href="javascript:" class="mem_ico ord_8 down c_down"></a> 
          <?php }?>
        <?php }?>
      </li>
      <li class="c"><?php echo CHtml::link('图片列表',array($this->pre_module_url.'/Album/admin','Album[zpc_id]'=>$data->zpc_id))?></li>
      <li class="d">
      		<?php echo CHtml::link(Yii::t('glo','Delete'),'javascript:',array('class'=>'c_06c','onclick'=>'return art_del_confirm("'.$this->pre_module_url.'/album/deleteAlbum/id/'.$data->zpc_id.'","你确定要删除吗？")'))?>
      </li>
    </ul>
</div>

  <?php
	  $this->widget('zii.widgets.CListView', array(
	  		'dataProvider'=>CmpCat::model()->getCatlist($data->zpc_id,3),
	  		'itemView'=>'_view',
	  		'itemsCssClass'=>'',
	  		'emptyText'=>'',
	  		'template'=>'{items}',
            'itemsTagName'=>'ul',
			'tagName'=>'none',
            'itemsOptions'=>array('class'=>($data->zpc_parentid==0)?"sub_class":"subsub_class"),
	  )); 
  ?>
  <?php if($data->zpc_topid==0){?>
  <div class="<?php echo ($data->zpc_parentid==0)?"sub_class":"subsub_class"?>">
    <ul class="c_f type">
      <li class="<?php echo ($data->zpc_parentid==0)?"sub_type":"item"?> add_class">
      <?php if($data->zpc_parentid>0){ ?>
      	<span class="mem_ico ico_class"></span><a href="javascript:" onclick="createCat(<?php echo $data->zpc_id; ?>)" title="">添加子分类</a>
      <?php }else{ ?>
      	<?php echo CHtml::linkbtn('添加二级分类',"javascript:",array('onclick'=>'createCat("'.$data->zpc_id.'")'))?>
      <?php } ?>
      </li>
    </ul>
  </div>
 <?php }?>
</li>